package com.tjwx.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping(value = "/")
public class PageController {
    private final static Logger logger = LoggerFactory.getLogger(PageController.class);

    /**
     * 登录
     * @param request
     * @param response
     * @param modelMap
     * @return
     */
    @RequestMapping(method = {RequestMethod.OPTIONS, RequestMethod.GET},value = "/login",produces = "application/json;charset=UTF-8")
    public Object loginpage(HttpServletRequest request, HttpServletResponse response,
                            ModelMap modelMap) {
        return "login";
    }

    /**
     * 跳转首页
     * @return
     */
    @RequestMapping(method = {RequestMethod.OPTIONS, RequestMethod.GET},value = "/")
    public String homepage( ) {
        return "homepage";
    }

    /**
     * 跳转详情页
     * @return
     */
    @RequestMapping(method = {RequestMethod.OPTIONS, RequestMethod.GET},value = "detail")
    public String detail() {
        return "detail";
    }
}
